﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Master.Master" CodeBehind="FIM_Prepare_Receive.aspx.cs" Inherits="KPIS.GERP.GFMS.APP.App_UI.Forms.FIM_Prepare_Receive" EnableEventValidation="false" %>
<%@ Register src="../UserControls/DatePicker.ascx" tagname="DatePicker" tagprefix="uc1" %>
<%@ Register src="../UserControls/DatePicker.ascx" tagname="DatePicker" tagprefix="uc2" %>

<asp:Content runat="server" contentplaceholderid="head">
    <title>Import File</title>
    <link href="../CssClass.css" rel="stylesheet" type="text/css" />
    <script language="JavaScript" src="../Scripts/Common.js" type="text/jscript"></script>
    <script language="JavaScript" src="../Scripts/DatePicker.js" type="text/jscript"></script>
    <style type="text/css">
        .formCaption {
            float: left;
            font-weight: bold;
            font-size: 12px;
            width: 200px;
            text-align: right;
            margin-right: 15px;
        }
        .style1
        {
            width: 173px;
        }
    </style>
</asp:Content>

<asp:Content runat="server" contentplaceholderid="ContentPlaceHolder1">
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script src="<%= Page.ResolveUrl("~/js/jquery-1.9.1.js") %>" type="text/javascript">
</script>
        <script type="text/javascript">


            var bodyOverflow, htmlOverflow; function closeHandler(sender, args) { document.body.style.overflow = bodyOverflow; document.documentElement.style.overflow = htmlOverflow; sender.remove_close(closeHandler); }
            function OpenPopUpHideParentScrollBar(url, radwindowId) { bodyOverflow = document.body.style.overflow; htmlOverflow = document.documentElement.style.overflow; document.body.style.overflow = "hidden"; document.documentElement.style.overflow = "hidden"; var oWnd = radopen(url, radwindowId); oWnd.add_close(closeHandler); return oWnd; }

            function openImportPayrollClick() {
                try {

                    var oWnd = OpenPopUpHideParentScrollBar("Upload.aspx", "FimPayrollImporterRadWindow");
                    oWnd.set_width(460);
                    oWnd.set_height(300);
                } catch (exception) {
                    alert(exception);
                }
            }

            function openPrintExcel2() {
                var cmdPrint = document.getElementById("<%= cmdPrint.ClientID %>");
                if (!cmdPrint.disabled) {
                    var RadWindow = $find("<%= cmdPrint.ClientID %>");
                    var oWnd = radopen("PopupPrintExcel.aspx?Seq=" + txtVal + "&Type=RE", "cmdPrint");
                    oWnd.close();
                }
            }

            function OpenWindow() {
                var cmdPrint = document.getElementById("<%= cmdPrint.ClientID %>");

                 if (!cmdPrint.disabled) {
                     var RadWindow = $find("<%= RadWindow1.ClientID %>");

                    radopen("ViewReport.aspx?name=Receipt", "RadWindow1");
                }
            }

            function openWinInvoice() {

                var recvDate = document.getElementById("<%= hdReceiveDate.ClientID%>").value;
                var recvMode = document.getElementById("<%= hdReceiveMode.ClientID%>").value;
                window.open("ViewInvoiceReport.aspx?receivedate=" + recvDate + "&receivemode=" + recvMode);

                return false;
            }
         </script>
    </telerik:RadCodeBlock>
<%--      <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="PanelAll">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="PanelAll" LoadingPanelID="RadAjaxLoadingPanel" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>--%>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel" runat="server" >
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadWindowManager runat="server" ID="RadWindowManager1" Skin="Vista">
        <Windows>
            <telerik:RadWindow Title="พิมพ์ใบเสร็จรับเงิน" ID="RadWindow1" runat="server" AutoSize="true" ReloadOnShow="True">
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>
    <asp:Panel runat="server" ID="PanelAll">
        <asp:Panel runat="server" ID="PanelCommand">
            <div class="DivControl" style="height:25px; padding-left:25px;">
                <table cellpadding="0" cellspacing="0" >
                    <tr>
                        <td>
                            <asp:LinkButton ID="btnUploadClick" CssClass="LinkButtonWhite" runat="server" OnClick="btnUploadClick_Click" >
                            <asp:Image ID="Image2" ImageUrl="~/App_UI/Images/Buttons/Movedown.gif" runat="server" Width="13px" Height="13px"/>
                                นำเข้าไฟล์ Excel การรับเงิน
                            </asp:LinkButton>
                        </td>
                        <td style="padding-left:10px;">
                            <uc2:DatePicker ID="dtRecieve" runat="server" />
                            <asp:HiddenField ID="hdReceiveSeq" runat="server" Visible="True" />
                        </td>
                        <td class="style1" align="center">
                            <telerik:RadComboBox ID="ddlFilterReceiveType" runat="server" 
                             AutoPostBack="True" Filter="Contains" 
                                onselectedindexchanged="ddlFilterReceiveType_SelectedIndexChanged">
                                <Items>
                                    <telerik:RadComboBoxItem runat="server" Text="การรับเงินเบิกจ่าย" Value="1" />
                                    <telerik:RadComboBoxItem runat="server" Text="การรับเงินรายได้" Value="2" />
                                </Items>
                            </telerik:RadComboBox>
                            <asp:HiddenField ID="hdReceiveDate" runat="server" Visible="True" />
                            <asp:HiddenField ID="hdReceiveMode" runat="server" Visible="True" />
                        </td>
                        <td style="padding-left:10px;">
                            <asp:LinkButton ID="cmdPrint" runat="server" CssClass="LinkButtonWhite" OnClientClick="return openWinInvoice()" >
                            <img alt="" id="img1" runat="server" src="~/App_UI/Images/Buttons/Print1.gif" height="18" /> พิมพ์รายงาน
                            </asp:LinkButton>

                            <asp:Button ID="btnConfirmt" runat="server" Text="ตรวจสอบข้อมูลแล้ว ยืนยันการบันทึก" OnClick="btnConfirmt_Click"/>
                            
                            <asp:Button ID="btnRollBack" runat="server" Text="อัพโหลดข้อมูลอีกครั้ง" OnClick="btnRollBack_Click"/>
                        </td>
                        <td style="padding-left:10px;"><span><b>&nbsp;<asp:Label ID="lblRemin" runat="server" ForeColor="Red"></asp:Label>
                            </b></span></td>
                    </tr>
                </table>
            </div>
        </asp:Panel>
        <asp:Panel ID="pnlIndex" runat="server" Width="1000px">
            <div class="DivInfo">
                <table width="100%" >
                    <tr  style="height:36px;">
                        <td>&nbsp;&nbsp;
                            <span style="font-weight: bold; font-size: 14px;">จัดเตรียมข้อมูลการรับเงิน</span> </td>
                    </tr>
                </table>
            </div>
        </asp:Panel>
        <asp:Panel ID="pnlRadGrid" runat="server" Width="1000px">
            <telerik:RadGrid ID="RadGridIndex" runat="server" AllowAutomaticDeletes="True" 
                AllowFilteringByColumn="False" AllowMultiRowEdit="True" GridLines="None"
                AllowMultiRowSelection="True" AllowPaging="True" AllowSorting="True" 
                AutoGenerateColumns="False" EnableAJAX="True" EnableAJAXLoadingTemplate="True" 
                OnItemCommand="RadGridIndex_ItemCommand" Skin="Simple" Width="998px" >
                <MasterTableView AllowMultiColumnSorting="True" CellSpacing="-1" 
                    ClientDataKeyNames="receive_seq" CommandItemDisplay="Top" DataKeyNames="receive_seq" 
                    EditMode="PopUp" InsertItemPageIndexAction="ShowItemOnCurrentPage" 
                    NoMasterRecordsText="&lt; ไม่มีข้อมูล &gt;">
                    <CommandItemTemplate>
                    </CommandItemTemplate>
                    <Columns>
                        <telerik:GridBoundColumn HeaderText="PK"  UniqueName="receive_seq" DataField="receive_seq" Visible="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn UniqueName="receive_seq" DataField="receive_seq" Visible="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn UniqueName="receive_mode" DataField="receive_mode" Visible="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn UniqueName="manual_receipt" DataField="manual_receipt" Visible="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn UniqueName="money_req_seq" DataField="money_req_seq" Visible="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn UniqueName="contact_address" DataField="contact_address" Visible="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn UniqueName="exclude_vat" DataField="exclude_vat" Visible="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn UniqueName="vat_amount" DataField="vat_amount" Visible="false">
                        </telerik:GridBoundColumn>
                        
                        <telerik:GridBoundColumn DataField="receive_type_name" HeaderText="ประเภทรายการรับเงิน" 
                            UniqueName="receive_type_name" AutoPostBackOnFilter="True" CurrentFilterFunction="Contains" 
                            FilterControlAltText="Filter title column" FilterControlWidth="100%" ShowFilterIcon="False">
                            <HeaderStyle HorizontalAlign="Center" Width="180px"/>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="bgm_source_name" HeaderText="แหล่งเงิน" 
                            UniqueName="bgm_source_name" AutoPostBackOnFilter="True" CurrentFilterFunction="Contains" 
                            FilterControlAltText="Filter title column" FilterControlWidth="100%" ShowFilterIcon="False">
                            <HeaderStyle HorizontalAlign="Center" Width="100px"/>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="receipt_no" HeaderText="เลขที่ใบเสร็จรับเงิน" 
                            UniqueName="receipt_no" AutoPostBackOnFilter="True" CurrentFilterFunction="Contains"
                            FilterControlAltText="Filter con_name column" 
                            FilterControlWidth="100%" ShowFilterIcon="False">
                            <HeaderStyle Width="70px" HorizontalAlign="Center"/>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn AutoPostBackOnFilter="True" CurrentFilterFunction="Contains" 
                            DataField="receive_date" FilterControlAltText="Filter receive_date column"  DataFormatString="{0:d}"
                            FilterControlWidth="100%" HeaderText="วันที่รับเงิน" ShowFilterIcon="False" UniqueName="receive_date">
                            <HeaderStyle Width="80px" HorizontalAlign="Center"/>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="method_name" HeaderText="รับเงินเป็น"  AllowFiltering="False"
                            UniqueName="method_name"  ShowFilterIcon="False" AutoPostBackOnFilter="True" CurrentFilterFunction="Contains" FilterControlWidth="100%">
                            <HeaderStyle Width="80px" HorizontalAlign="Center"/>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="temp_contact" HeaderText="รับเงินจาก" AllowFiltering="False"
                            UniqueName="temp_contact" ShowFilterIcon="False" AutoPostBackOnFilter="True" CurrentFilterFunction="Contains" FilterControlWidth="100%">
                            <HeaderStyle Width="150px" HorizontalAlign="Center"/>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="amount" HeaderText="จำนวนเงิน(บาท)"  AllowFiltering="False"
                            UniqueName="amount" DataFormatString="{0:n}" ShowFilterIcon="False" 
                            DataType="System.Decimal" AutoPostBackOnFilter="True" CurrentFilterFunction="Contains" FilterControlWidth="100%">
                            <HeaderStyle Width="100px" HorizontalAlign="Center"/>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="contact_tax_code" HeaderText="รหัสประจำตัวผู้เสียภาษี"  AllowFiltering="False"
                            UniqueName="contact_tax_code" ShowFilterIcon="False" AutoPostBackOnFilter="True" CurrentFilterFunction="Contains" FilterControlWidth="100%">
                            <HeaderStyle Width="100px" HorizontalAlign="Center"/>
                        </telerik:GridBoundColumn>
                    </Columns>
                    <PagerStyle AlwaysVisible="true" Mode="NextPrevNumericAndAdvanced" />
                </MasterTableView>
                <ClientSettings AllowColumnHide="True" AllowColumnsReorder="True" 
                    EnableRowHoverStyle="True" ReorderColumnsOnClient="True">
                    <Selecting AllowRowSelect="True" EnableDragToSelectRows="true" />
                </ClientSettings>
            </telerik:RadGrid>
        </asp:Panel>
        <asp:Panel  ID="pnlUpload" runat="server">
            <div class="DivInfo" style="padding-left:15px; height:36px;">
            นำเข้าไฟล์ Excel จัดเตรียมการรับเงิน
            </div>
            <div class="Div2" style="padding-left:35px;">
                <br/>
                <div>
                    <table>
                        <tr>
                            <td>ปี :</td>
                            <td>
                                <telerik:RadNumericTextBox ID="txtBgmYear" runat="server"
                                Width="100px" ShowSpinButtons="True" AutoPostBack="true"
                                NumberFormat-DecimalDigits="0" NumberFormat-GroupSeparator="">
                                </telerik:RadNumericTextBox>
                            </td>
                            <td>แหล่งเงิน : </td>
                            <td>
                                <telerik:RadComboBox ID="ddlFilterBgmSourceSeq" runat="server" AutoPostBack="true"
                                    DataTextField="bgm_source_name" DataValueField="bgm_source_seq" Filter="Contains"
                                    OnSelectedIndexChanged="ddlFilterBgmSourceSeq_SelectedIndexChanged"
                                >
                                </telerik:RadComboBox>
                            </td>
                        </tr>
                        <tr>
                            <td></td>
                        </tr>
                        <tr>
                            <td>ประเภทรายการรับเงิน :</td>
                            <td>
                                <telerik:RadComboBox ID="ddlReceiveTypeSeq" Runat="server" Width="300px"
                                DataTextField="receive_type_name" DataValueField="receive_type_seq"
                                AutoPostBack="true" CausesValidation="false" Filter="Contains"
                                    OnSelectedIndexChanged="ddlReceiveTypeSeq_SelectedIndexChanged">
                                </telerik:RadComboBox>
                            </td>
                        </tr>
                        <tr>
                            <td>สมุดเงินฝากธนาคาร :</td>
                            <td>
                                <telerik:RadComboBox ID="ddlBankAccSeq" Runat="server" Width="300px"
                                DataTextField="bank_acc_name" DataValueField="bank_acc_seq"
                                AutoPostBack="false" CausesValidation="false" Filter="Contains">
                                </telerik:RadComboBox>
                            </td>
                        </tr>
                    </table>
                </div>
                <br/>
                <br/>
                <asp:FileUpload ID="FileUpload" runat="server" />
                &nbsp;<asp:Button ID="btnUpload" runat="server" 
                Text="Upload and Save" OnClick="btnUpload_Click" />
                <br/>
                <span style="color:grey; font-style: italic; font-size: xx-small">กรุณาเลือกไฟล์ Excel ในฟอร์แมต Excel เงินเดือน (ไฟล์ .xlsx, .xls)</span> <a id="A1" runat="server" href="~/Share/จัดเตรียมการรับเงิน.xlsx">(ดาวน์โหลดต้นแบบ)</a>
                <br/>
                <br/>
                <asp:Label runat="server" ID="lblSuccess" ForeColor="Green" Font-Size="15px"></asp:Label>
                <asp:Label runat="server" ID="lblError" ForeColor="Red" Font-Size="15px"></asp:Label>
                <asp:Label runat="server" ID="lblErrorTemp" ForeColor="Red" Font-Size="15px"></asp:Label>
            </div>
        </asp:Panel>
        <%--<asp:Panel ID="pnlTabDownload" runat="server">
            <div class="Div2" style="padding-left:175px;">
                <img src="../Images/Buttons/loading.gif" style="width:95px; height:95px"/>
                <br />กำลังอัพโหลดข้อมูล กรุณารอสักครู่
            </div>
        </asp:Panel>--%>
        <asp:Panel ID="pnlShowTemp" runat="server">
            <asp:Panel ID="pnlTextTemp" runat="server" Width="1000px">
                <div class="DivInfo">
                    <table width="100%" >
                        <tr  style="height:36px;">
                            <td>&nbsp;&nbsp;
                            <span style="font-weight: bold; font-size: 14px;">กรุณาตรวจสอบข้อมูลก่อนการบันทึก</span> </td>
                        </tr>
                    </table>
                </div>
            </asp:Panel>
            <asp:Panel ID="pnlConclude" runat="server">
                <table width="100%" style="padding-top:10px;">
                    <tr >
                        <td colspan="3" class="DivControl" style="padding-left:20px;">สรุปรายการที่ได้อัพโหลด</td>
                    </tr>
                    <tr>
                        <td style="padding-left:20px;">อัพโหลดสำเร็จ : </td>
                        <td>
                            <asp:Label ID="lblSuccess1" runat="server"></asp:Label>
                        </td>
                        <td>รายการ </td>
                    </tr>
                    <tr>
                        <td style="padding-left:20px;">อัพโหลดไม่สำเร็จ :</td>
                        <td><b>
                            <asp:Label ID="lblFail" runat="server"></asp:Label>
                            </b></td>
                        <td>รายการ </td>
                    </tr>
                    <tr>
                        <td style="padding-left:20px; color:red;">รายการที่อัพโหลดไม่สำเร็จ :</td>
                        <td><b>
                            <asp:TextBox ID="lblListFail" runat="server" ForeColor="Red"></asp:TextBox>
                            </b></td>
                        <td><b>รวมทั้งหมดมี : <b>
                            <asp:Label ID="lblSumList" runat="server"></asp:Label>
                            รายการ </b></b></td>
                    </tr>
                </table>
            </asp:Panel>
            <telerik:RadGrid ID="dgTemp" runat="server" AllowAutomaticDeletes="True" 
                AllowFilteringByColumn="False" AllowMultiRowEdit="True" 
                AllowMultiRowSelection="True" AllowPaging="False" AllowSorting="True" 
                AutoGenerateColumns="False" EnableAJAX="True" EnableAJAXLoadingTemplate="True" 
                GridLines="None" Skin="Simple" Width="1000px" >
                <MasterTableView AllowMultiColumnSorting="True" CellSpacing="-1" 
                    ClientDataKeyNames="receive_seq" CommandItemDisplay="Top" DataKeyNames="receive_seq" 
                    EditMode="PopUp" InsertItemPageIndexAction="ShowItemOnCurrentPage" 
                    NoMasterRecordsText="&lt; ไม่มีข้อมูล &gt;">
                    <CommandItemTemplate>
                    </CommandItemTemplate>
                    <Columns>
                        <telerik:GridBoundColumn HeaderText="PK"  UniqueName="receive_seq" DataField="receive_seq" Visible="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn  UniqueName="flag" DataField="flag" Visible="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="vat_percent" UniqueName="vat_percent" Visible="false">                            
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="receive_type_name" HeaderText="ประเภทรายการรับเงิน" 
                            UniqueName="receive_type_name" AutoPostBackOnFilter="True" CurrentFilterFunction="Contains" 
                            FilterControlAltText="Filter title column" FilterControlWidth="100%" ShowFilterIcon="False">
                            <HeaderStyle HorizontalAlign="Center" Width="100px"/>
                            <ItemStyle HorizontalAlign="Left" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="bgm_source_name" HeaderText="แหล่งเงิน" 
                            UniqueName="bgm_source_name" AutoPostBackOnFilter="True" CurrentFilterFunction="Contains" 
                            FilterControlAltText="Filter title column" FilterControlWidth="100%" ShowFilterIcon="False">
                            <HeaderStyle HorizontalAlign="Center" Width="100px"/>
                            <ItemStyle HorizontalAlign="Left" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="receipt_no" HeaderText="เลขที่ใบเสร็จรับเงิน" 
                            UniqueName="receipt_no" AutoPostBackOnFilter="True" CurrentFilterFunction="Contains"
                            FilterControlAltText="Filter con_name column" 
                            FilterControlWidth="100%" ShowFilterIcon="False">
                            <HeaderStyle Width="170px" HorizontalAlign="Center"/>
                            <ItemStyle HorizontalAlign="Center" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn AutoPostBackOnFilter="True" CurrentFilterFunction="Contains" 
                            DataField="receive_date" FilterControlAltText="Filter mas_source_name column"  DataFormatString="{0:d}"
                            FilterControlWidth="100%" HeaderText="วันที่รับเงิน" ShowFilterIcon="False" UniqueName="receive_date">
                            <HeaderStyle Width="100px" HorizontalAlign="Center"/>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="method_name" HeaderText="รับเงินเป็น"  AllowFiltering="False"
                            UniqueName="method_name"   ShowFilterIcon="False" CurrentFilterFunction="Contains" 
                            FilterControlWidth="100%" AutoPostBackOnFilter="True" FilterControlAltText="Filter method_name column">
                            <HeaderStyle Width="100px" HorizontalAlign="Center"/>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="temp_contact" HeaderText="รับเงินจาก" AllowFiltering="False"
                            UniqueName="temp_contact" ShowFilterIcon="False" AutoPostBackOnFilter="false" FilterControlWidth="50px">
                            <HeaderStyle Width="100px" HorizontalAlign="Center"/>
                            <ItemStyle HorizontalAlign="Right" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="exclude_vat" HeaderText="จำนวนเงินไม่รวม Vat"  AllowFiltering="False" DataFormatString="{0:n}"
                            UniqueName="exclude_vat" ShowFilterIcon="False">
                            <HeaderStyle Width="100px" HorizontalAlign="Center"/>
                            <ItemStyle HorizontalAlign="Right" />
                        </telerik:GridBoundColumn>                        
                        <telerik:GridBoundColumn DataField="vat_amount" HeaderText="ภาษีมูลค่าเพิ่ม"  AllowFiltering="False" DataFormatString="{0:n}"
                            UniqueName="vat_amount" ShowFilterIcon="False">
                            <HeaderStyle Width="100px" HorizontalAlign="Center"/>
                            <ItemStyle HorizontalAlign="Right" />
                        </telerik:GridBoundColumn>  
                        <telerik:GridBoundColumn DataField="include_vat" HeaderText="จำนวนเงิน(บาท)"  AllowFiltering="False" DataFormatString="{0:n}"
                            UniqueName="include_vat" ShowFilterIcon="False">
                            <HeaderStyle Width="100px" HorizontalAlign="Center"/>
                            <ItemStyle HorizontalAlign="Right" />
                        </telerik:GridBoundColumn>                      
                        <telerik:GridBoundColumn DataField="contact_address" HeaderText="ที่อยู่"  AllowFiltering="False"
                            UniqueName="contact_address" ShowFilterIcon="False">
                            <HeaderStyle Width="100px" HorizontalAlign="Center"/>
                            <ItemStyle HorizontalAlign="Right" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="contact_tax_code" HeaderText="รหัสประจำตัวผู้เสียภาษี"  AllowFiltering="False"
                            UniqueName="contact_tax_code" ShowFilterIcon="False">
                            <HeaderStyle Width="100px" HorizontalAlign="Center"/>
                            <ItemStyle HorizontalAlign="Right" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="contact_branch" HeaderText="รหัสสาขา(สำนักงาน)"  AllowFiltering="False"
                            UniqueName="contact_branch" ShowFilterIcon="False">
                            <HeaderStyle Width="100px" HorizontalAlign="Center"/>
                            <ItemStyle HorizontalAlign="Right" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="remarks" HeaderText="หมายเหตุ"  AllowFiltering="False"
                            UniqueName="remarks" ShowFilterIcon="False">
                            <HeaderStyle Width="100px" HorizontalAlign="Center"/>
                            <ItemStyle HorizontalAlign="Right" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="qty" HeaderText="จำนวนหน่วย"  AllowFiltering="False"
                            UniqueName="qty" ShowFilterIcon="False">
                            <HeaderStyle Width="100px" HorizontalAlign="Center"/>
                            <ItemStyle HorizontalAlign="Center" />
                        </telerik:GridBoundColumn>
                    </Columns>
                    <PagerStyle AlwaysVisible="true" Mode="NextPrevNumericAndAdvanced" />
                </MasterTableView>
                <ClientSettings AllowColumnHide="True" AllowColumnsReorder="True" 
                    EnableRowHoverStyle="True" ReorderColumnsOnClient="True">
                    <Selecting AllowRowSelect="True" EnableDragToSelectRows="true" />
                </ClientSettings>
            </telerik:RadGrid>
        </asp:Panel>
    </asp:Panel>
</asp:Content>